﻿using RabbitMQ.Client;
using System.Text;

namespace Producer.Producers
{
    public class Fanout
    {
        public static void Sender()
        {
            using (var conection = Common.RabbitUtils.GetConnention().CreateConnection())
            {
                using (var channel = conection.CreateModel())
                {
                    string msg = "20度";
                    var body=Encoding.UTF8.GetBytes(msg);
                    channel.BasicPublish(Common.RabbitConstant.EXCHANGE_WEATHER, "", null, body);
                    Console.WriteLine("发送成功");
                }
            }
        }
    }
}
